﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Xyz.BusinessObjects;
using Xyz.DataObjects.Interfaces;

namespace Xyz.DataObjects.Entity.Dao
{
    public class EntityCardPaymentDao : ICardPaymentDao
    {
        public void CreatePayment(CardPayment payment)
        {
            using (var context = EntityObjectFactory.CreateContext())
            {
                payment.PaymentDate = DateTime.Now;
                context.CardPaymentEntities.AddObject(Mapper.Map(payment));

                context.SaveChanges();
            }
        }
    }
}
